<?php

/**

 * The import/export menu

 *

 * Copyright (C) 2008  Sean Hickey

 * 

 * This program is free software: you can redistribute it and/or modify

 * it under the terms of the GNU General Public License as published by

 * the Free Software Foundation, either version 3 of the License, or

 * (at your option) any later version.

 *

 * This program is distributed in the hope that it will be useful,

 * but WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

 * GNU General Public License for more details.

 *

 * You should have received a copy of the GNU General Public License

 * along with this program.  If not, see <http://www.gnu.org/licenses/>.

 *

 * @author Sean Hickey <sean@headzoo.com>

 * @version $Id: ImportExport.php 394 2008-07-03 05:49:00Z sean $

 */

?>

<div class="wrap">

	<h2>Import/Export</h2>

	<?php echo Alinks_Popup::show(Alinks_Popup::KEY_IMPORT_EXPORT); ?>

	<form method="post">

		<input type="hidden" name="<?php echo Alinks_Form::FORM_ALINKS; ?>" value="export" />

		<?php wp_nonce_field(Alinks_Form::NONCE_ACTION); ?>

		<fieldset class="<?php echo Alinks_Form::CLASS_FIELDSET_FACTORIES; ?>">

			<legend>Export</legend>

			<ul class="<?php echo Alinks_Form::CLASS_FORM; ?>">

				<li>

					<label for="alinks_export_settings">Export aLinks Settings: </label>

					<input type="checkbox" value="1" id="alinks_export_settings" name="settings" />

					<input type="hidden" value="0" name="__settings" />

					<div><small>Include your aLinks settings in the exported document.</small></div>

				</li>

				<li class="alt">

					<label for="alinks_export_factories">Export Factory Settings: </label>

					<input type="checkbox" value="1" id="alinks_export_factories" name="factory_settings" />

					<input type="hidden" value="0" name="__factory_settings" />

					<div><small>Include all the factory settings in the exported document.</small></div>

				</li>

				<li>

					<label for="alinks_format">Document Format: </label>

					<select id="alinks_format" name="format">

						<option value="xml"<?php if (Alinks_Settings::get('alinks', Alinks_Settings::DEFAULT_EXPORT, Alinks_Settings::DEFAULT_DEFAULT_EXPORT) == 'xml') echo ' selected="selected"'; ?>>aLinks 2.0 XML</option>

						<option value="csv"<?php if (Alinks_Settings::get('alinks', Alinks_Settings::DEFAULT_EXPORT, Alinks_Settings::DEFAULT_DEFAULT_EXPORT) == 'csv') echo ' selected="selected"'; ?>>CSV</option>

						<option value="excel2000"<?php if (Alinks_Settings::get('alinks', Alinks_Settings::DEFAULT_EXPORT, Alinks_Settings::DEFAULT_DEFAULT_EXPORT) == 'excel2000') echo ' selected="selected"'; ?>>Microsoft Excel 2000</option>

						<option value="excelxml"<?php if (Alinks_Settings::get('alinks', Alinks_Settings::DEFAULT_EXPORT, Alinks_Settings::DEFAULT_DEFAULT_EXPORT) == 'excelxml') echo ' selected="selected"'; ?>>Microsoft Excel 2003 XML</option>

					</select>

					<div><small>The aLinks 2.0 XML format is currently the <em style="color: #FF0000">only</em> format that can be imported back into aLinks. The CSV and Excel formats will not include aLinks or factory settings.</small></div>

				</li>

			</ul>

			<div class="submit">

				<input type="submit" value="Export &raquo;" />

			</div>

		</fieldset>

	</form>

	

	<form method="post" enctype="multipart/form-data">

		<input type="hidden" name="<?php echo Alinks_Form::FORM_ALINKS; ?>" value="import" />

		<?php wp_nonce_field(Alinks_Form::NONCE_ACTION); ?>

		<fieldset class="<?php echo Alinks_Form::CLASS_FIELDSET_FACTORIES; ?>">

			<legend>Import</legend>

			<ul class="<?php echo Alinks_Form::CLASS_FORM; ?>">

				<li>

					<label for="alinks_import_settings">Import Settings: </label>

					<input type="checkbox" value="1" id="alinks_import_settings" name="settings" />

					<input type="hidden" value="0" name="__settings"  />

					<div><small>Import settings from the document (If available).</small></div>

				</li>

				<li class="alt">

					<label for="alinks_import_factories">Import Factory Settings: </label>

					<input type="checkbox" value="1" id="alinks_import_factories" name="factory_settings" />

					<input type="hidden" value="0" name="__factory_settings" />

					<div><small>Import factory settings from the document (If available).</small></div>

				</li>

				<li>

					<label for="alinks_upload">Select Document: </label>

					<input type="file" id="alinks_upload" name="file" />

					<div><small>Select the aLinks 2.0 XML document previously exported by aLinks. The old .ale format is still supported.</small></div>

				</li>

			</ul>

			<div class="submit">

				<input type="submit" value="Import &raquo;" />

			</div>

		</fieldset>

	</form>

</div>

